/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cliente;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Kaotar
 */
public class TesteCliente {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Cliente cliente = new Cliente();
        int x;
        String str;

        cliente.setNick(("1"));
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        x = cliente.connect();
        Thread t = new Thread(cliente);
        t.start();
        try {
            while ((str = reader.readLine()) != null) {
                if (str.charAt(0) == '\\') {
                    cliente.createChannel(str.substring(1));
                } else if (str.charAt(0) == '/') {
                    cliente.joinChannel(str.substring(1));
                } else {
                    cliente.sendMessage(str, "#LOL");
                }
            }
        } catch (IOException ex) {
            //Exceção
        }
    }
}
